import request from '@/utils/request'

// 创建头部轮播图
export function createBanner(data) {
  return request({
    url: '/system/banner/create',
    method: 'post',
    data: data
  })
}

// 更新头部轮播图
export function updateBanner(data) {
  return request({
    url: '/system/banner/update',
    method: 'put',
    data: data
  })
}

// 删除头部轮播图
export function deleteBanner(id) {
  return request({
    url: '/system/banner/delete?id=' + id,
    method: 'delete',
    data: id
  })
}

// 获得头部轮播图
export function getBanner(id) {
  return request({
    url: '/system/banner/get?id=' + id,
    method: 'get'
  })
}

// 获得头部轮播图分页
export function getBannerPage(params) {
  return request({
    url: '/system/banner/page',
    method: 'get',
    params
  })
}
// 导出头部轮播图 Excel
export function exportBannerExcel(params) {
  return request({
    url: '/system/banner/export-excel',
    method: 'get',
    params,
    responseType: 'blob'
  })
}
